package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.ScoreRulesDao;
import cn.topevery.garden.entity.po.ScoreRules;
import cn.topevery.garden.entity.query.ScoreRulesQuery;
import cn.topevery.garden.entity.vo.ScoreRulesVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class ScoreRulesLogic extends BaseLogic<ScoreRules> {
    @Autowired
    ScoreRulesDao scoreRulesDao;

    @Override
    public BaseEntityDao<ScoreRules, Integer> getDao() {
        return scoreRulesDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<ScoreRulesVO> listPage(ScoreRulesQuery query) {
        return scoreRulesDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        scoreRulesDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param scoreRules 实体
     */
    public void saveOrUpdate(String userId, ScoreRules scoreRules){
        scoreRulesDao.saveOrUpdate(userId,scoreRules);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public ScoreRules getEntityByColumn(String key, String value) {
        return scoreRulesDao.getEntityByColumn(key, value);
    }
}
